/**
 * 
 */
package com.yi.backend.db.api;

import java.util.List;

import com.mongodb.DBObject;
import com.mongodb.MongoException;
import com.yi.backend.model.CommonModel;

/**
 * @author long
 * 
 */
public interface IMongoDBHelperApi {

	public void createDBTableByName(final String schemaName)
			throws MongoException;

	public String create(final String schemaName, final DBObject dbObject)
			throws MongoException;

	public void update(final String schemaName, final DBObject dbObject)
			throws MongoException;

	public DBObject viewById(final String schemaName, final String modelId)
			throws MongoException;

	public DBObject viewByName(final String schemaName, final String modelName)
			throws MongoException;

	public Object viewFieldById(final String schemaName, final String modelId,
			final String fieldName) throws MongoException;

	public Object viewFieldByName(final String schemaName, final String modelName,
			final String fieldName) throws MongoException;
			
	public void removeById(final String schemaName, final String modelId)
			throws MongoException;

	public List<DBObject> list(final String schemaName, final int pageNumber)
			throws MongoException;

}
